import Vue from 'vue'
import VueRouter from 'vue-router'
import SystemAdminLayout from "@/views/SystemAdminLayout";
import ReceptionAdminLayout from "@/views/ReceptionAdminLayout";
import WashAdminLayout from "@/views/WashAdminLayout";
import UserLayout from "@/views/UserLayout";
import WaiterAdminLayout from "@/views/WaiterAdminLayout.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/HelloWorld',
    name: 'HelloWorld',
    component: () => import('../components/HelloWorld')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/login')
  },
  {
    path: '/systemadmin',
    name: 'SystemAdminLayout',
    component: SystemAdminLayout,
    redirect:'/systemadminhome',
    children:[
      {
        path: '/systemadminhome',
        name: 'systemadminhome',
        component: () => import('../views/systemAdmin/SystemAdminHomeView')
      },
      {
        path: '/systemadmin/vipkind',
        name: 'VipKind',
        component: () => import('../views/systemAdmin/VipKind')
      },
      {
        path: '/systemadmin/desk',
        name: 'desk',
        component: () => import('../views/systemAdmin/desk.vue')
      },
      {
        path: '/systemadmin/caipin',
        name: 'caipin',
        component: () => import('../views/systemAdmin/caipin.vue')
      },
      {
        path: '/clothes/material',
        name: 'Material',
        component: () => import('../views/systemAdmin/ClothesMaterial')
      },
      {
        path: '/wash/kind',
        name: 'WashKind',
        component: () => import('../views/systemAdmin/WashKind')
      },
      {
        path: '/clothes/kind',
        name: 'ClothesKind',
        component: () => import('../views/systemAdmin/ClothesKind')
      },
      {
        path: '/step',
        name: 'Step',
        component: () => import('../views/systemAdmin/Step')
      },
      {
        path: '/manage/receptionadmin',
        name: 'ManageReceptionAdmin',
        component: () => import('../views/systemAdmin/ManageReceptionAdmin')
      },
      {
        path: '/manage/chefadmin',
        name: 'ManageWashAdmin',
        component: () => import('../views/systemAdmin/ManageChefAdmin.vue')
      },
      {
        path: '/manage/waiteradmin',
        name: 'ManageWashAdmin',
        component: () => import('../views/systemAdmin/ManageWaiterAdmin.vue')
      },
      {
        path: '/news',
        name: 'News',
        component: () => import('../views/systemAdmin/News')
      },
      {
        path: '/systemadmin/order',
        name: 'order',
        component: () => import('../views/systemAdmin/Order.vue')
      },
      {
        path: '/systemadmin/SYSOrderInfo',
        name: 'SYSOrderInfo',
        component: () => import('../views/systemAdmin/SYSOrderInfo.vue')
      },

    ]
  },
  {
    path: '/receptionadmin',
    name: 'ReceptionAdminLayout',
    component: ReceptionAdminLayout,
    redirect:'/receptionadminhome',
    children:[
      {
        path: '/receptionadminhome',
        name: 'receptionadminhome',
        component: () => import('../views/receptionAdmin/ReceptionAdminHomeView')
      },
      {
        path: '/receptionadmin/vipinfo',
        name: '/receptionadmin/vipinfo',
        component: () => import('../views/receptionAdmin/VipInfo')
      },

      {
        path: '/receptionadmin/addorder',
        name: 'AddOrder',
        component: () => import('../views/receptionAdmin/AddOrder'),
        props: route => ({userNum: route.query.userNum,userId:route.query.userId})
      },
      {
        path: '/receptionadmin/YuyueOrder',
        name: 'YuyueOrder',
        component: () => import('../views/receptionAdmin/YuyueOrder')
      },
      {
        path: '/receptionadmin/dingzhuo',
        name: 'dingzhuo',
        component: () => import('../views/receptionAdmin/dingzhuo')
      },
      {
        path: '/receptionadmin/orderitem',
        name: 'OrderItem',
        component: () => import('../views/receptionAdmin/OrderItem'),
        props: route => ({param: route.query.param})
      },
      {
        path: '/receptionadmin/orderiteminfo',
        name: 'OrderItemInfo',
        component: () => import('../views/receptionAdmin/OrderItemInfo'),
        props: route => ({param: route.query.param,flag:route.query.flag})
      },
      {
        path: '/receptionadmin/order',
        name: 'order',
        component: () => import('../views/systemAdmin/Order.vue')
      },
      {
        path: '/receptionadmin/SYSOrderInfo',
        name: 'SYSOrderInfo',
        component: () => import('../views/systemAdmin/SYSOrderInfo.vue')
      },
    ]
  },
  {
    path: '/chefadmin',
    name: 'WashAdminLayout',
    component: WashAdminLayout,
    redirect:'/chefadminhome',
    children:[
      {
        path: '/chefadminhome',
        name: 'washadminhome',
        component: () => import('../views/washAdmin/WashAdminHomeView')
      },
      {
        path: '/washadmin/order',
        name: 'washadminorder',
        component: () => import('../views/washAdmin/WashAdminOrder')
      },
      {
        path: '/washadmin/orderiteminfo1',
        name: 'OrderItemInfo1',
        component: () => import('../views/washAdmin/OrderItemInfo'),
        props: route => ({param: route.query.param,flag:route.query.flag})
      },

    ]
  },
  {
    path: '/waiteradmin',
    name: 'WaiterAdminLayout',
    component: WaiterAdminLayout,
    redirect:'/waiteradminhome',
    children:[
      {
        path: '/waiteradminhome',
        name: 'washadminhome',
        component: () => import('../views/waiterAdmin/WaiterAdminHomeView')
      },
      // {
      //   path: '/washadmin/order',
      //   name: 'washadminorder',
      //   component: () => import('../views/washAdmin/WashAdminOrder')
      // },
      // {
      //   path: '/washadmin/orderiteminfo1',
      //   name: 'OrderItemInfo1',
      //   component: () => import('../views/washAdmin/OrderItemInfo'),
      //   props: route => ({param: route.query.param,flag:route.query.flag})
      // },

    ]
  },
  {
    path: '/user',
    name: 'UserLayout',
    component: UserLayout,
    redirect:'/userhome',
    children:[
      {
        path: '/userhome',
        name: 'UserHomeView',
        component: () => import('../views/user/UserHomeView')
      },
      {
        path: '/newsItem',
        name: 'newsItem',
        component: () => import('../views/user/NewsItem')
      },
      {
        path: '/about',
        name: 'About',
        component: () => import('../views/user/About')
      },
      {
        path: '/userlogin',
        name: 'UserLogin',
        component: () => import('../views/user/UserLogin')
      },
      {
        path: '/userregister',
        name: 'UserRegister',
        component: () => import('../views/user/UserRegister')
      },
      {
        path: '/userforgetpassword',
        name: 'UserForgetPassword',
        component: () => import('../views/user/UserForgetPassword')
      },
      {
        path: '/userinfo',
        name: 'UserInfo',
        component: ()=>import('../views/user/UserInfo')
      },
      {
        path: '/userchangepassword',
        name: 'UserChangePassword',
        component: ()=>import('../views/user/UserChangePassword')
      },
      {
        path: '/yuyue',
        name: 'Yuyue',
        component: ()=>import('../views/user/YuYue')
      },
      {
        path: '/historyorder',
        name: 'HistoryOrder',
        component: ()=>import('../views/user/HistoryOrder')
      },
      {
        path: '/historyYuyue',
        name: 'HistoryYuyue',
        component: ()=>import('../views/user/HistoryYuyue')
      },
      {
        path: '/orderinfo',
        name: 'OrderInfo',
        component: ()=>import('../views/user/OrderInfo'),
        props: route => ({param: route.query.param,flag:route.query.flag})
      },
      {
        path: '/buyvip',
        name: 'BuyVip',
        component: ()=>import('../views/user/BuyVip')
      },
      {
        path: '/vipcenter',
        name: 'VipCenter',
        component: ()=>import('../views/user/VipCenter')
      },
      {
        path: '/diancan',
        name: 'diancan',
        component: ()=>import('../views/user/diancan')
      },
      {
        path: '/yuyue',
        name: 'yuyue',
        component: ()=>import('../views/user/YuYue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
